#!/usr/bin/perl
BEGIN{push(@INC,"../lib/")};
use core;
use dispatch;
#set server ip port
$server = core::new("core","0.0.0.0",9999);
#regsite funcs t1 t2 t3
$server->dispatcher_reg("t1",\&t1);
$server->dispatcher_reg("t2",\&t2);
$server->dispatcher_reg("t3",\&t3);
core::start_server($server);

sub t1 {
    my ($self) = @_;
    print("hello t1\n");
    return("from t1 hello cli @_\n");
}
sub t2 {
    my ($self) = @_;
    print("hello t2\n");
    return("from t2 hello cli @_\n");
}
sub t3{
    print("in t3\n");
    open(FH,">>","./recv.file");
    print(@_);
    print FH @_;
    close(FH);

}